package crm.view.desktop.iFrame.views;

import javax.swing.DefaultListModel;

import crm.model.teacherPC.CRMListener;
import crm.model.teacherPC.Manager;
import crm.model.teacherPC.net.StudentPC;



public class HistorieListModel extends DefaultListModel implements CRMListener {
	StudentPC student;
	Manager m;
	public HistorieListModel(StudentPC student, Manager m) {
		this.m=m;
		this.student=student;
		m.addListener(this);
	}


	public void actualisingComplete(StudentPC student) {

		for (int j = 0; j < student.getWindows().size(); j++) {
			boolean found = true;
			if(size()==0){
				addElement(student.getWindows().get(j));
				continue;
			}
			for (int i = 0; i < size(); i++) {

				if(get(i).equals(student.getWindows().get(j))){
					found = false;
				}
			}
			if(found){
				addElement(student.getWindows().get(j));
			}
		}
	}

	@Override
	public void connectionClosed() {
		// TODO Auto-generated method stub

	}

	@Override
	public void connectionStarted() {
		// TODO Auto-generated method stub

	}


	@Override
	public void exitCRM() {
		// TODO Auto-generated method stub

	}


	@Override
	public void studentAdded(StudentPC student) {
		// TODO Auto-generated method stub

	}


	@Override
	public void studentRemoved(StudentPC student) {
		// TODO Auto-generated method stub

	}

}
